<template>
	<!-- 物流信息 -->
	<view class="warp">
		<c-navBar title="物流信息" isSeat></c-navBar>
		<view class="header">
			<view class="he-title">{{logData.name}}</view>
			<view class="he-no" v-if="logData.logisticsNumber">
				快递单号：{{logData.logisticsNumber?logData.logisticsNumber:''}}</view>
		</view>

		<view class="ma-top"></view>
		
			<view class="main">
				<scroll-view scroll-y>
				<view class="scroll">
					<u-steps dot :current="current" direction="column" activeColor="#2AD03D">
						<u-steps-item :title="item.context" :desc="item.time" v-for="(item,index) in list"
							:key="index"></u-steps-item>
					</u-steps>
				</view>
				</scroll-view>
			</view>
		

		<view class="defaultBox" v-if="list.length==0">
			<image src="../../../static/empty/icon2.png" mode=""></image>
			<view>暂无物流信息~</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id: '', //订单id
				goodsId: '', //商品id
				active: 1,
				list: [],
				current: 0,
				logData: {
					data: []
				},
				expressName: ''
			}
		},
		onLoad(options) {
			this.id = options.id
			this.getList()
		},
		methods: {
			getList() {
				this.$api.getLogisticsInfo({
					id: this.id
				}).then(res => {
					console.log(res, "物流详情");
					if (res.data) {
						this.logData = res.data
						let arr = JSON.parse(res.data.logisticsInfo)
						if (arr.data) {
							this.list = arr.data
							this.current = res.data.length
						}

					}
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.warp{
		width: 100vw;
		min-height: 100vh;
	}
	.header {
		background: #BDF7C3;
		padding: 52rpx 32rpx;
		padding-top: 200rpx;
		box-sizing: border-box;

		.he-title {
			font-size: 32rpx;
			font-weight: bold;
			color: #1A1A1A;
		}

		.he-no {
			font-size: 24rpx;
			font-weight: 400;
			color: #333333;
			margin-top: 12rpx;
		}
	}

	.ma-top {
		background: #fff;
		height: 20rpx;
		width: 100%;
		border-radius: 16rpx 16rpx 0rpx 0rpx;
		margin-top: -19rpx;
	}

	.main {
		
		padding: 16rpx 30rpx;
		.scroll{
			height: calc(100vh - 400rpx);
		}
	}
</style>